Fundamental to human intelligence is the ability to abstract a general rule from prior experiences and then apply this rule to new stimuli so as to infer likely outcomes. The processes of abstraction and inference work in tandem to inform the expectations that drive both behavior (e.g., choosing the best option) and affect (e.g., excitement for a reward). Dysfunction in these processes leads to distorted expectations, and in turn, the maladaptive behavior and emotions that are a hallmark of psychiatric disease. Inferred expectations can be inflated positively, as in substance use and mania, or negatively, as in depression, PTSD and generalized anxiety, leading to avoidance behavior and dysphoric or anxious affect. The critical role of abstraction and inference in healthy and pathological behavior belies our limited understanding of their neural basis. While past work has shown neural representations change with abstract learning (e.g., increased representational similarity), the link between the specific format of neural representation and behavioral function (i.e., inference) remains untested. Moreover, most existing tasks focus on abstract learning from reward, leaving open questions about abstraction during aversive outcomes, which is fundamental to most mental illness. Here we propose to develop a theoretical framework for how the brain represents past stimuli in a format that reflects abstract knowledge and a mechanism for using this structured representation to infer the properties of novel stimuli. This framework will be coupled with a behavioral task in humans that captures the essential elements of real-world abstraction, including appetitive and aversive outcomes, and an analysis approach for fMRI that tests the functional link between the format of representation in the human brain and inference behavior. To fill these gaps, the proposed work in humans leverages recent findings in the monkey showing that populations of single neurons represent stimuli in an abstract format that supports inference. Translating this work will advance understanding of the neural basis of abstraction in humans. I propose to accomplish this with two specific aims. First, I will develop a novel behavioral task in which human subjects learn an implicit rule from prior experience and use this rule to infer rewarded actions during concurrent fMRI. Using a novel computational method, I will test whether the format of representations of experienced stimuli supports inference about unexperienced stimuli. I will further validate the link between brain and behavior by testing the predictions that the neural format emerges with learning and that it explains individual variation in inference. Second, I will compare the roles of appetitive and aversive outcomes on abstract rule learning and on the formation of neural representations that support inference. This work will lay the foundation for studying the neural basis of abstraction in humans and, more generally, will establish a roadmap for linking population-level neural representations in fMRI to behavioral function. Future work would extend this framework to understand the neural basis of pathological inference in mood and anxiety disorders.